﻿using System;
using System.Collections.Generic;
using System.Text;

namespace OkTool.Excel
{
    [AttributeUsage(AttributeTargets.Property)]
    public class ExcelImport : System.Attribute
    {
        /// <summary>
        /// 字段名称
        /// </summary>
        public string Value { get; }

        /// <summary>
        /// 导出映射，格式如：0-未知;1-男;2-女
        /// </summary>
        public string Kv { get; set; } = "";

        /// <summary>
        /// 是否为必填字段（默认为非必填）
        /// </summary>
        public bool Required { get; set; } = false;

        /// <summary>
        /// 最大长度（默认255）
        /// </summary>
        public int MaxLength { get; set; } = 255;

        /// <summary>
        /// 导入唯一性验证（多个字段则取联合验证）
        /// </summary>
        public bool Unique { get; set; } = false;

        public ExcelImport(string value)
        {
            Value = value;
        }
    }
}
